import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    count: 100
  },
  getters: {
    getCount(state) {
      return state.count
    }
  },
  mutations: {
   
    setCount: (state) => {
      debugger
      state.count++
    }
    
  },
  actions: {
    invokecount(state) {
      debugger
      setTimeout(() => {
        debugger
        state.commit("setCount")
      }, 1000)      
    } 
  },
  modules: {
  }
})
